# print(1+2+3+4+5+6+7+8+9)


# # *********1到9连加************************
# a = 0
# for i in range(1, 10):
#     a = a+i
#     i = i+1
#     # print(a)

# print(a)

# # # *********1到9连加************************
# a = 0
# for i in range(0, 9):
#     i = i+1
#     a = a+i
#     # print(i)

# print(a)
# # # ********sum方法***************************
# print(sum(range(1, 10)))

# # # *********while***************************
# a = 0
# i = 0
# while i < 9:
#     i = i+1
#     a = a+i
#     print(i)
# print(a)

# def sum():
#     a = 0
#     for n in range(1,10):
#         a = a+n
#     return a

# print(sum())

a = []
for i in range(1,10):
    a.append(i)
    # print(a)

print(sum(a))
a =[1,2,3,4,5,6,7,8,9]
print(sum([1,2,3,4,5,6,7,8,9]))


# *********1到N求和**************************
# N = input("请输入整型参数：")
# N = int(N)
# sum = 0
# for i in range(1, N+1):
#     sum = sum+i
# print(sum)


# def sum(num):
#     a = 0
#     for n in range(1,num+1):
#         a = a+n
#     return a


# N = input("请输入整型参数：")
# N = int(N)
# print(sum(N))

# *********1到N求和**************************
# while 1:
#     print("求1到N的和")
#     N = input("请输入一个正整数：")
#     # N = eval(N)
#     if N.isdigit() == True:
#         N = int(N)
#         if N != 0:
#             sum = 0
#             for i in range(1, N+1):
#                 sum = sum+i
#             print("1到{}之间数字之和为：{}".format(i, sum))
#         else:
#             print("请重新输入一个正整数")
#     else:
#         print("N值只能为正整数")
#         print("请重新输入一个正整数")

# ********************************************
a = input("请输入整型参数：")
a = int(a)
if a == 1:
    b = sum(range(1, 6))
    print(b)
    # print(sum(range(1, 6)))
elif a == 2:
    b = sum(range(6, 10))
    print(b)
else:
    print(0)
